#!/bin/python
#-*- coding:utf-8 -*-
# Filename:    main.py
# Revision:    1.0
# Date:        2012-06-14
# Author:      simonzhang
# web:         www.simonzhang.net
# Email:       simon-zzm@163.com
### END INIT INFO
import time
import random
import tornado.ioloop
import tornado.locale
import tornado.web
from dbmodel import *
from interface import *


class SetUpHandler(BaseHandler):
    @tornado.web.authenticated
    def get(self):
        _get_user = self.check_user()
        _domain, _title = if_get_domain_title()
        _get_user_left_menu = if_get_user_left_menu(_get_user)
        _get_user_manage_project = if_get_user_project(_get_user)
        self.render("templates/setup.html", domain=_domain, title=_title, \
                                            username = _get_user, \
                                            items=_get_user_left_menu, pros=_get_user_manage_project)
    def post(self):
        _get_user = self.check_user()
        _domain, _title = get_domain_title()
        _get_user_left_menu = get_user_left_menu(_get_user)
        _get_user_manage_project = get_user_project(_get_user)
        _get_project_name = self.get_arguments('s')[0]
        self.render("templates/setup.html", domain=_domain, title=_title, \
                                            username = _get_user, \
                                            items=_get_user_left_menu)
